﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Collections;
using SteriaMummert.SharePoint.SoftwareFactoryLite.Editors;
using System.Drawing.Design;
using Microsoft.Practices.ComponentModel;
using EnvDTE;

namespace SMC.SPALM.Types
{
    [ServiceDependency(typeof(DTE))]
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter)), CategoryAttribute("Migration Settings")]
    public class ContentType
    {
        private string _ID = Guid.NewGuid().ToString().Replace("-","").ToUpper();
        private string _Name = "";
        private string _Description = "";
        private string _Group = "";
        private NameValueItem _ParentContentType = null;
        private string _Version = "0";
        private ContentTypeFieldRef[] _FieldRefs = new ContentTypeFieldRef[0];
        private ContentTypeFieldRef[] _RemoveFieldRefs = new ContentTypeFieldRef[0];
        
        public ContentType()
        {
        }

        [Category("TestProperties")] 
        public ContentTypeFieldRef[] RemoveFieldRefs
        {
            get { return _RemoveFieldRefs; }
            set { _RemoveFieldRefs = value; }
        }

        [Category("TestProperties")] 
        public ContentTypeFieldRef[] FieldRefs
        {
            get { return _FieldRefs; }
            set { _FieldRefs = value; }
        }

		[Category("TestProperties")] 
		public string Name
		{
			get{return _Name;}
			set{_Name= value;}
		}

        [Category("TestProperties")] 
        public string Version
        {
            get { return _Version; }
            set { _Version = value; }
        }

        [Category("TestProperties")] 
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

		[Category("TestProperties")]
        public string ID
		{
            get { return _ID; }
            set { _ID = value; }
		}

        [Category("TestProperties")]
        [Editor(typeof(SharePointConfigurationContentTypeEditor), typeof(UITypeEditor))]
        public NameValueItem ParentContentType
        {
            get { return _ParentContentType; }
            set { _ParentContentType = value; }
        }

        [Category("TestProperties")]
        public string Group
        {
            get { return _Group; }
            set { _Group = value; }
        }
    }    
}
